// Next.js API route support: https://nextjs.org/docs/api-routes/introduction

//http://localhost:3000/api/hello  可以模拟api接口
//还可以对mock.json进行增删改查,所以数据量不大且关系不复杂,确实Next可以完成全栈工作

import type { NextApiRequest, NextApiResponse } from 'next'
import mock from './mock.json'

type Data = {
  name: string
}

export default function handler(
  req: NextApiRequest,
  res: NextApiResponse<Data>
) {
  res.status(200).json(mock)
}
